from pydantic import BaseModel, EmailStr
from datetime import date
from typing import Optional

class TeacherBase(BaseModel):
    name: str
    email: EmailStr
    department: str
    date_of_birth: date
    hire_date: date

class TeacherCreate(TeacherBase):
    pass

class TeacherUpdate(BaseModel):
    name: Optional[str] = None
    email: Optional[EmailStr] = None
    department: Optional[str] = None
    date_of_birth: Optional[date] = None
    hire_date: Optional[date] = None

class Teacher(TeacherBase):
    id: int

    class Config:
        orm_mode = True